package com.ludomancy.spaceopera.entities;

import java.awt.Graphics;
import com.ludomancy.spaceopera.BasicEntity;
import com.ludomancy.spaceopera.Game;
import com.ludomancy.spaceopera.InventoryItem;
import com.ludomancy.spaceopera.Player;
import com.ludomancy.spaceopera.SpaceWorld;

public class BlasterItem extends InventoryItem
{
	public BlasterItem()
	{
		super(TYPE_BLASTER);
		desc = "StarSling (TM): Weapon. Really nasty. Uses stars as bullets. Shoots a focused nova. Do not look into the firing end.";
		// TODO: fix
		cost = 0;
	}
	
	public void paintPlayerUnderlay(Graphics g, int x, int y)
	{
	}
		
	public boolean update()
	{
		return false;
	}
	
	public boolean interact(BasicEntity e)
	{
		if(e instanceof Star)
		{
			// blaaaast!!!
			Game.game.player.activated = false;
			Star s = (Star) e;
			s.parent.remove(s);
			Game.game.currentWorld.add(new StarBlast(s));
			return true;
		}
		return false;
	}
	
	public String getInteractionVerbFor(BasicEntity e)
	{
		if(e instanceof Star)
		{
			return "Shoot!";
		}
		return super.getInteractionVerbFor(e);
	}

	public void update(Player player, boolean activated)
	{
	}

	public boolean canBeUsed()
	{
		return Game.game.currentWorld instanceof SpaceWorld;
	}
}
